//
//  HomeModel.m
//  share_business
//
//  Created by 吴于凌 on 2017/9/23.
//  Copyright © 2017年 wyl. All rights reserved.
//

#import "HomeModel.h"

@implementation HomeModel

//父类中的 data数据，转化的对象是列表
//+(NSValueTransformer *)dataJSONTransformer{
//    return [MTLJSONAdapter arrayTransformerWithModelClass:[HomeModelDate class]];
//}
//父类中的data数据，转化的对象是对象
+ (NSValueTransformer *)dataJSONTransformer {
    return [MTLJSONAdapter dictionaryTransformerWithModelClass:[HomeModelDate class]];
}
@end


@implementation  HomeModelDate


+ (NSDictionary *)JSONKeyPathsByPropertyKey{
    return @{
             @"BannerList" : @"BannerList",
             @"Specials" : @"Specials",
             @"Lifes":@"Lifes"
             };
}
//SubList数据，转成列表
+(NSValueTransformer *)BannerListJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[HomeModelBannerList class]];
}
//父类中的data数据，转化的对象是对象
+ (NSValueTransformer *)SpecialsJSONTransformer {
    return [MTLJSONAdapter dictionaryTransformerWithModelClass:[HomeModelSpecials class]];
}
//父类中的data数据，转化的对象是对象
+ (NSValueTransformer *)LifesJSONTransformer {
    return [MTLJSONAdapter dictionaryTransformerWithModelClass:[HomeModelLifes class]];
}
@end


@implementation  HomeModelBannerList

+ (NSDictionary *)JSONKeyPathsByPropertyKey{
    return @{
             @"Image" : @"Image",
             @"Title" : @"Title",
             @"Type":@"Type",
             @"Param":@"Param",
             @"OrderIndex":@"OrderIndex"
             };
}
@end

@implementation HomeModelSpecials

+ (NSDictionary *)JSONKeyPathsByPropertyKey{
    return @{
             @"title" : @"title",
             @"ProductList" : @"ProductList"
             };
}

//SubList数据，转成列表
+(NSValueTransformer *)ProductListJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[HomeModelProductList class]];
}
@end

@implementation HomeModelLifes

+ (NSDictionary *)JSONKeyPathsByPropertyKey{
    return @{
             @"title" : @"title",
             @"ProductList" : @"ProductList"
             };
}

//SubList数据，转成列表
+(NSValueTransformer *)ProductListJSONTransformer{
    return [MTLJSONAdapter arrayTransformerWithModelClass:[HomeModelProductList class]];
}
@end

@implementation HomeModelProductList


+ (NSDictionary *)JSONKeyPathsByPropertyKey{
    return @{
             @"ProductId" : @"ProductId",
             @"ShareValue" : @"ShareValue",
             @"ProductImage":@"ProductImage",
             @"ProductName":@"ProductName",
             @"ProductPrice":@"ProductPrice",
             @"ProductOldPrice":@"ProductOldPrice"
             };
}
@end


